import * as tagsApi from '@/api/hmmm/tags'

const tags = {
  namespaced: true,
  state: {
    tagsList: {},
    catalogList: []
  },
  mutations: {
    SET_TAGS_LIST (state, newValue) {
      state.tagsList = newValue
    },
    SET_CATALOG_LIST (state, newValue) {
      state.catalogList = newValue
    }
  },
  actions: {
    async updateTagsListList ({ commit }, params) {
      const res = await tagsApi.list(params)
      commit('SET_TAGS_LIST', res)
    },
    async updateCatalogList ({ commit }, params) {
      const res = await tagsApi.simple(params)
      commit('SET_CATALOG_LIST', res)
    }
  }
}
export default tags
